package centralRepository;

/**
 * Interface definition: ServerObject.
 * 
 * @author OpenORB Compiler
 */
public abstract class ServerObjectPOA extends org.omg.PortableServer.Servant
        implements ServerObjectOperations, org.omg.CORBA.portable.InvokeHandler
{
    public ServerObject _this()
    {
        return ServerObjectHelper.narrow(_this_object());
    }

    public ServerObject _this(org.omg.CORBA.ORB orb)
    {
        return ServerObjectHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:server/ServerObject:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    private static final java.util.Map operationMap = new java.util.HashMap();

    static {
            operationMap.put("getEdPortNum",
                    new Operation_getEdPortNum());
            operationMap.put("getHostname",
                    new Operation_getHostname());
            operationMap.put("getId",
                    new Operation_getId());
            operationMap.put("getLePortNum",
                    new Operation_getLePortNum());
            operationMap.put("getName",
                    new Operation_getName());
            operationMap.put("getPortNum",
                    new Operation_getPortNum());
            operationMap.put("getStation",
                    new Operation_getStation());
            operationMap.put("getStatus",
                    new Operation_getStatus());
            operationMap.put("isLeader",
                    new Operation_isLeader());
            operationMap.put("setLeader",
                    new Operation_setLeader());
            operationMap.put("setStatus",
                    new Operation_setStatus());
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        final AbstractOperation operation = (AbstractOperation)operationMap.get(opName);

        if (null == operation) {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }

        return operation.invoke(this, _is, handler);
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_getPortNum(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getPortNum();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getEdPortNum(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getEdPortNum();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getLePortNum(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getLePortNum();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getStation(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getStation();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_isLeader(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        boolean _arg_result = isLeader();

        _output = handler.createReply();
        _output.write_boolean(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_setLeader(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        boolean arg0_in = _is.read_boolean();

        setLeader(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getStatus(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getStatus();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_setStatus(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();

        setStatus(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getName(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getName();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getId(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getId();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getHostname(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = getHostname();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    // operation classes
    private abstract static class AbstractOperation {
        protected abstract org.omg.CORBA.portable.OutputStream invoke(
                ServerObjectPOA target,
                org.omg.CORBA.portable.InputStream _is,
                org.omg.CORBA.portable.ResponseHandler handler);
    }

    private static final class Operation_getPortNum extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getPortNum(_is, handler);
        }
    }

    private static final class Operation_getEdPortNum extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getEdPortNum(_is, handler);
        }
    }

    private static final class Operation_getLePortNum extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getLePortNum(_is, handler);
        }
    }

    private static final class Operation_getStation extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getStation(_is, handler);
        }
    }

    private static final class Operation_isLeader extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_isLeader(_is, handler);
        }
    }

    private static final class Operation_setLeader extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_setLeader(_is, handler);
        }
    }

    private static final class Operation_getStatus extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getStatus(_is, handler);
        }
    }

    private static final class Operation_setStatus extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_setStatus(_is, handler);
        }
    }

    private static final class Operation_getName extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getName(_is, handler);
        }
    }

    private static final class Operation_getId extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getId(_is, handler);
        }
    }

    private static final class Operation_getHostname extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final ServerObjectPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_getHostname(_is, handler);
        }
    }

}
